package cn.tedu.icop.user.controller;
import cn.tedu.icop.user.service.UserService;
import cn.tedu.icop.api.domain.ChargingUser;
import cn.tedu.icop.api.model.RestResult;
import cn.tedu.icop.api.model.RestResultUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("user")
@Api(tags = "用户接口")
public class UserController {
    @Autowired
    private UserService userService;
    @ApiOperation("获取用户信息")
    @GetMapping("/vehicle/{userId}")
    public RestResult<Integer> getUserBindVehicleId(@PathVariable("userId") Integer userId) {
        log.debug("获取用户信息入参:{}",userId);
        Integer vehicleId = userService.getUserBindVehicleId(userId);
        log.debug("获取的车辆id为:{}",vehicleId);
        return  RestResultUtils.success(vehicleId);
    }
}
